<?php

use yii\db\Migration;

class m180812_142032_product extends Migration
{
    public function up()
    {
        $this->addColumn('{{%products}}', 'veneer', $this->string()->notNull()->defaultValue('')->comment('内饰面')->after('preview'));
        $this->addColumn('{{%products}}', 'outside_handle', $this->string()->notNull()->defaultValue('')->comment('内把手')->after('veneer'));
        $this->addColumn('{{%products}}', 'inside_handle', $this->string()->notNull()->defaultValue('')->comment('外把手')->after('outside_handle'));
        $this->addColumn('{{%products}}', 'lockset', $this->string()->notNull()->defaultValue('')->comment('锁具')->after('inside_handle'));
    }

    public function down()
    {
        $this->dropColumn('{{%products}}', 'veneer');
        $this->dropColumn('{{%products}}', 'outside_handle');
        $this->dropColumn('{{%products}}', 'inside_handle');
        $this->dropColumn('{{%products}}', 'lockset');
    }
}
